Detect when a conflicting editable install exists#150
Detect when a conflicting editable install exists#150stefanv merged 3 commits intoscientific-python:mainfrom
Conversation
|
This seems right to me. It seems to me that use of The NumPy docs spell it out very clearly right now (see note above https://numpy.org/devdocs/building/index.html#customizing-builds):
|
spin/cmds/meson.py
Outdated
|
|
||
| try: | ||
| dist = importlib_metadata.Distribution.from_name(package) | ||
| if dist.origin.dir_info.editable: |
There was a problem hiding this comment.
Should this also raise a different warning if a non-editable but installed distribution is detected? Possibly outside the directory expected by spin? That might lead to similar confusion.
Looks like an improvement otherwise! 👍
There was a problem hiding this comment.
Fortunately, a non-editable installation does not cause problems.
The editable installs are particularly obnoxious, because their hooks are run before the PYTHONPATH takes effect.
Since we now have a way to detect editable installs, we could potentially switch build and PYTHONPATH-setting to no-ops if the editable matches the current directory. I'll look into that as a follow-up PR. |

Closes #143
I'd like to check with @rgommers that this won't impact the workflow of those using editable packages. Do those users also use spin? If so, should we more explicitly accommodate editable installs, and simply skip the build step?